/**
 * 
 */
package cn.suse.android.logic;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;

import cn.suse.android.entity.RepasteDetail;

/**
 * @author liubin
 * Create DateTime:Oct 19, 2012 3:18:33 PM
 * Description:
 * @Version: 1.0.0
 */
public class RepasteDetailParse extends BaseParse<RepasteDetail> {

	/* (non-Javadoc)
	 * @see cn.suse.android.logic.BaseParse#parseData(java.lang.String)
	 */
	@SuppressWarnings("finally")
	@Override
	public List<RepasteDetail> parseData(String content) {
		// TODO Auto-generated method stub
		List<RepasteDetail> lists = null;
		try {
			JSONObject jsonObject = new JSONObject(content);
			JSONObject dataJsonObject = jsonObject.getJSONObject("data");
			RepasteDetail repasteDetail = new RepasteDetail();
			lists = new ArrayList<RepasteDetail>();
			repasteDetail.setContent(dataJsonObject.getString("content"));
			repasteDetail.setCtime(dataJsonObject.getString("ctime"));
			repasteDetail.setFirst_name(dataJsonObject.getString("first_name"));
			repasteDetail.setFirst_uid(dataJsonObject.getString("first_uid"));
			repasteDetail.setRepaste_total(dataJsonObject.getString("repaste_total"));
			repasteDetail.setTitle(dataJsonObject.getString("title"));
			repasteDetail.setView_total(dataJsonObject.getString("view_total"));
			lists.add(repasteDetail);
		} catch (JSONException e) {}
		finally{
			return lists;
		}
	}

}
